﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Windows.Forms;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Threading;
namespace RegexJson
{
    static class Program
    {

        static string mutexFlagStr = "frmMain";
        static public bool requestRestart = false;
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            // 通过互斥来防止程序多重启动
            bool blnCreate;
            Mutex m = new Mutex(true, mutexFlagStr, out   blnCreate);
            if (blnCreate)
            {
                Application.Run(new FrmMian());
                m.ReleaseMutex();
                m.Close();
                if (requestRestart)
                {
                    Application.Restart();
                }
            }
            else
            {
                MessageBox.Show("程序已经启动，不能再次启动！");
                Application.Exit();
            }
           
        }


    }
}
